/*
Sam Snyder
CS362
Assignment 3
cardtest1.c

This is a test of the smithy card
*-----------------------------------------------------------------------
 * Include the following lines in your makefile:
 *
 * cardtest1: cardtest1.c dominion.o rngs.o
 *      gcc -o cardtest1 -g  cardtest1.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include <math.h>
#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include <time.h>
#include <stdlib.h>



// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

 int main() {
 	int r, pre, seed, choice1, choice2, choice3, handPos, bonus;
 	struct gameState G;
 	int k[10] = {curse, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};
 	if (NOISY_TEST == 1)
 		printf("Testing smithy card\n\n");
	srand(time(NULL));
	seed = rand();

	r = initializeGame(MAX_PLAYERS, k, seed, &G);

	pre = G.handCount[0];
	printf("initial hand count = %d\n", pre);
 	cardEffect( smithy, choice1, choice2,  choice3, &G, 0, &bonus);
 	
 	//check if hand is correct size
 	 	if (NOISY_TEST == 1)
 		printf("New count = %d, should be %d\n", G.handCount[0], pre+3-1);//+3 discard smithy
 		assert(G.handCount[0] == pre + 3-1);


 	if (NOISY_TEST == 1)
 		printf("Tests passed");
 	return 0;
 }